package io.renren.common.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @Author liang
 * @Date 2018/4/19 15:44
 */
@Aspect
@Component
public class ZhixingfangfaAspect {
    @Pointcut("@annotation(io.renren.common.annotation.Zhixingfangfa)")
    public void zhixingPointCut(){

    }
    @Around("zhixingPointCut()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        Signature signature = point.getSignature();
        MethodSignature signature2 = (MethodSignature) point.getSignature();
        String className = point.getTarget().getClass().getName();
        String name = signature.getName();
        String name2 = signature2.getName();
//        System.out.println("正在执行："+className+"中"+name+"();");
        System.out.println("正在执行："+className+"中"+name2+"();");
        Object object = point.proceed();
        return object;
    }
}
